// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#pragma once

#ifndef STRICT
#define STRICT
#endif

#include "targetver.h"

#define _ATL_APARTMENT_THREADED

#define _ATL_NO_AUTOMATIC_NAMESPACE

#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS	// some CString constructors will be explicit


#define ATL_NO_ASSERT_ON_DESTROY_NONEXISTENT_WINDOW

#include "resource.h"
#include <atlbase.h>
#include <atlcom.h>
#include <atlctl.h>
#include <WinSCard.h>

// copy policy
template < class T >
class _CopyVariantFromInterface
{
public:
	static HRESULT copy(VARIANT* pV, const T* pIP)
	{
		HRESULT hr = (*pIP)->QueryInterface(IID_IDispatch, (void**)&pV->pdispVal);
		if(SUCCEEDED(hr) )
			pV->vt = VT_DISPATCH;
		else
		{
			(*pIP)->AddRef();
			pV->vt = VT_UNKNOWN;
			pV->punkVal = (*pIP);
		}
		return S_OK;
	}

	static void init(VARIANT* p) { VariantInit(p); }
	static void destroy(VARIANT* p) { VariantClear(p); }
};
